1. Field of the Invention
The present invention relates to automatic baud detection by asynchronous receiver/transmitters and more particularly, to automatic baud detection with adjustment to a programmable baud rate.
2. Description of the Related Art
Specialized microcontrollers with integrated communication features are becoming particularly attractive for communications applications. A microcontroller, or an embedded controller, is uniquely suited to combining functionality onto one monolithic semiconductor substrate (i.e. chip). By embedding various communication features within a single chip, a communications microcontroller may support a wide range of communication applications.
A typical feature of a microcontroller has been a universal asynchronous receiver/transmitter (UART) for providing asynchronous serial communication. Since communication applications (e.g. Integrated Systems Digital Network (ISDN) applications) frequently employ high data transfer rates for asynchronous serial communication, asynchronous serial ports are of particular importance to communications microcontrollers.
Certain communications microcontrollers, such as the MC68360 available from Motorola, Inc., have utilized automatic baud detection (also known as autobauding) in determining a baud rate for data to and from asynchronous serial ports. A baud rate is the rate at which data is sent and received over an asynchronous serial link by a microcontroller. The baud rate must be predetermined or determined through autobauding and independently controlled on both the sending and receiving ends. The standard baud rates in the industry have included 1200, 2400, 4800, 9600, 19.2K, 28.8K, 33.3K, 54K, and 115K data transfer rates. Asynchronous serial communication is commonly used for transferring data to and from memory, or across a bridge from one data bus or device to another. When data is transferred from one bus or device to another, synchronization can be very difficult. Accurately determining a baud rate is therefore important to ensuring successful transmission and reception of data by a microcontroller.
In autobauding, a baud rate has commonly been determined automatically from the length or size of a start bit of a data or character stream. A baud rate is typically produced by a baud rate generator. Autobauding has typically been performed by a UART. For a baud rate generator of a UART, a low level on a receive data line frequently designated RXD typically corresponds to the beginning of the start bit. When a low level or high to low transition on the receive data line is detected, the UART begins counting the start bit length. The UART terminates the counting in response to a low to high transition. An input clock to the baud generator should generally be as fast as possible to improve the accuracy of the start bit measurement.
A start bit of a data stream has been susceptible to line distortions and noise. If a noise pulse or line distortion xe2x80x9chitsxe2x80x9d the start bit, the length of the start bit has become shorter or longer. The altered size of the start bit, which constitutes a sampling error, is then used to determine a baud divisor. As is understood in the art, a baud rate is a function of the baud divisor. For a UART, a clock is typically divided by the baud divisor and multiplied by a certain factor to obtain the baud rate. The baud rate calculated from the determined baud divisor has been determined incorrectly because the baud divisor is based on an incorrect size of the start bit. For example, the baud divisor derived from a shorter start bit length is smaller than a baud divisor based on the pre-noise start bit length. The baud rate calculated from the smaller baud divisor is higher than a baud divisor based on the pre-noise start bit length. Autobauding thus may be subject to significant inaccuracies when an incoming data stream is distorted.
Line distortions and noise have particularly been a concern at high baud rates where line distortions and noise are significant. In addition, at high baud rates, the finite frequency of the input clock of the baud rate generator produces more significant inaccuracies. Because of these concerns, asynchronous receiver/transmitters using autobauding have avoided high baud rates so as to maintain acceptable ranges of accuracy and reliability.
Briefly, the present invention provides an asynchronous receiver/transmitter and method for autobauding with adjustment to a programmable baud rate. When autobauding is enabled, the asynchronous receiver/transmitter detects the size of a start bit. A baud divisor is calculated based on the start bit size and stored in a baud divisor register. The asynchronous receiver/transmitter provides a plurality of baud divisor replacement registers, each register storing a baud divisor threshold and a baud divisor replacement. The baud divisor replacement may be set to baud divisors for standard or non-standard baud rates. The baud divisor is compared to the plurality of programmed baud divisor thresholds. Based on the performed hardware comparison, the baud divisor is automatically replaced by a baud divisor replacement for a particular baud divisor range defined by a baud divisor threshold(s) and including the baud divisor. The baud divisor replacement takes place immediately following the start bit and before the next byte of data is received. The baud rate corresponding to this baud divisor replacement represents the appropriate baud rate. The hardware comparison and replacement operations are controlled by a baud divisor controller.
In accordance with the present invention, automatic adjustment to a programmed baud rate compensates for any alteration of a start bit size by line distortion or noise. As a result, autobauding is performed with improved accuracy and reliability. Further, an asynchronous receiver/transmitter utilizing this compensation mechanism, may achieve considerable accuracy even at high baud rates.